﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SB.UserSettings
{
    public class UserSetting
    {
        public string Name
        {
            set;
            get;
        }

        public string Text
        {
            set;
            get;
        }

        public UserSetting(string name, string text)
        {
            Name = name;
            Text = text;
        }

        public override string ToString()
        {
            if (Text == null)
                return "<" + Name + " />";

            return "<" + Name + "> " + Text + " <" + Name + " />";
        }

        public override bool Equals(object obj)
        {
            if (obj is UserSetting)
            {
                UserSetting a = (UserSetting)obj;
                if (a.Name == Name)
                    return true;
            }
            return false;
        }
    }
}
